package com.example.day09_zuoye.p;

import com.example.day09_zuoye.CallBack;
import com.example.day09_zuoye.Rec_Bean;
import com.example.day09_zuoye.m.M_Model;
import com.example.day09_zuoye.v.V_View;

import java.util.List;

public class P_Presenter implements CallBack {
    private V_View view;
    private M_Model model;
    public P_Presenter(V_View view) {
        this.view = view;
        model = new M_Model();
    }


    public void getData() {
        model.getData(this);
    }

    @Override
    public void onSuccess(List<Rec_Bean.DataBean.DatasBean> list) {
        view.setData(list);
    }

    @Override
    public void onFail(String strs) {
        view.showToast(strs);
    }
}
